package ytdp.careagle.com.ytdp.entity;

import android.text.TextUtils;

import com.google.gson.Gson;
import com.mcxtzhang.indexlib.suspension.ISuspensionInterface;

import java.util.List;

/**
 * Created by lida on 2017/7/31 0031.
 */

public class ModelRelationship {
    /**
     * modelYear : 2017
     * children : [{"brandCode":"brand-41","brandName":"大众","code":"14298-n","hide":0,"id":"0a226577-9210-4965-8de8-415e357202c5","modelYear":"2017","name":"2017款 高尔夫 1.6L 自动舒适百万辆纪念版","parent":"series-266","seriesName":"高尔夫","subBrandName":"一汽-大众"},{"brandCode":"brand-41","brandName":"大众","code":"14304-n","hide":0,"id":"cb4b567d-3a96-413c-abf7-1ad904273e75","modelYear":"2017","name":"2017款 高尔夫 280TSI 自动R-Line百万辆纪念版","parent":"series-266","seriesName":"高尔夫","subBrandName":"一汽-大众"}]
     */

    private String modelYear;
    private List<ChildrenBean> children;

    public static ModelRelationship objectFromData(String str) {

        return new Gson().fromJson(str, ModelRelationship.class);
    }

    public String getModelYear() {
        return modelYear;
    }

    public void setModelYear(String modelYear) {
        this.modelYear = modelYear;
    }

    public List<ChildrenBean> getChildren() {
        return children;
    }

    public void setChildren(List<ChildrenBean> children) {
        this.children = children;
    }

    public static class ChildrenBean implements ISuspensionInterface {
        /**
         * brandCode : brand-41
         * brandName : 大众
         * code : 14298-n
         * hide : 0
         * id : 0a226577-9210-4965-8de8-415e357202c5
         * modelYear : 2017
         * name : 2017款 高尔夫 1.6L 自动舒适百万辆纪念版
         * parent : series-266
         * seriesName : 高尔夫
         * subBrandName : 一汽-大众
         */

        private String brandCode;
        private String brandName;
        private String code;
        private int hide;
        private String id;
        private String modelYear;
        private String name;
        private String parent;
        private String seriesName;
        private String seriesCode;
        private String subBrandName;
        private String imageUrl;

        public static ChildrenBean objectFromData(String str) {

            return new Gson().fromJson(str, ChildrenBean.class);
        }

        public String getSeriesCode() {
            return seriesCode;
        }

        public void setSeriesCode(String seriesCode) {
            this.seriesCode = seriesCode;
        }

        public String getImageUrl() {
            return imageUrl;
        }

        public void setImageUrl(String imageUrl) {
            this.imageUrl = imageUrl;
        }

        public String getBrandCode() {
            return brandCode;
        }

        public void setBrandCode(String brandCode) {
            this.brandCode = brandCode;
        }

        public String getBrandName() {
            return brandName;
        }

        public void setBrandName(String brandName) {
            this.brandName = brandName;
        }

        public String getCode() {
            return code;
        }

        public void setCode(String code) {
            this.code = code;
        }

        public int getHide() {
            return hide;
        }

        public void setHide(int hide) {
            this.hide = hide;
        }

        public String getId() {
            return id;
        }

        public void setId(String id) {
            this.id = id;
        }

        public String getModelYear() {
            return modelYear;
        }

        public void setModelYear(String modelYear) {
            this.modelYear = modelYear;
        }

        public String getName() {
            return name;
        }

        public void setName(String name) {
            this.name = name;
        }

        public String getParent() {
            return parent;
        }

        public void setParent(String parent) {
            this.parent = parent;
        }

        public String getSeriesName() {
            return seriesName;
        }

        public void setSeriesName(String seriesName) {
            this.seriesName = seriesName;
        }

        public String getSubBrandName() {
            return subBrandName;
        }

        public void setSubBrandName(String subBrandName) {
            this.subBrandName = subBrandName;
        }

        @Override
        public boolean isShowSuspension() {
            return true;
        }

        @Override
        public String getSuspensionTag() {
            if (TextUtils.isEmpty(modelYear)) {
                return "暂无";
            }
            return modelYear + "款";
        }
    }
}
